package com.insigma.mvc.service.pub.impl;

import com.insigma.mvc.repository.main.dao.pub.GetFileMapper;
import com.insigma.mvc.service.pub.GetFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;

/**
 *
 */
@Service
@Transactional
public class GetFileImpl implements GetFileService {
    
    @Autowired
    private GetFileMapper getFileMapper;


    @Override
    public HashMap<String, String> getFile(String tableName, String id) {

        HashMap<String, String> map = new HashMap<String, String>();
        map.put("tableName",tableName);
        map.put("id",id);
        List<HashMap<String, String>> list = getFileMapper.getFile(map);
        if( list!=null && list.size()>0 ){
            return list.get(0);
        }
        else{
            return null;
        }
    }
}
